﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SqLiteEditor.Forms
{
    /// <summary>
    /// Interaction logic for FrmRenameTable.xaml
    /// </summary>
    public partial class FrmRenameTable : Window
    {
        public FrmRenameTable()
        {
            InitializeComponent();

            DataContext = this;
        }

        public FrmRenameTable( string _OldName ) 
            : this()
        {
            OldName = _OldName;
        }

        
        public string OldName
        {
            get { return (string)GetValue(OldNameProperty); }
            set { SetValue(OldNameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for OldName.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty OldNameProperty =
            DependencyProperty.Register("OldName", typeof(string), typeof(FrmRenameTable), new PropertyMetadata(String.Empty));


        public string NewName
        {
            get { return (string)GetValue(NewNameProperty); }
            set { SetValue(NewNameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for OldName.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty NewNameProperty =
            DependencyProperty.Register("NewName", typeof(string), typeof(FrmRenameTable), new PropertyMetadata(String.Empty));

        private void BtnOk_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
            Close();
        }

        private void BtnCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }

    }
}
